<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>考试管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/x-admin.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header header header-demo">
    <div class="layui-main">
    <div class="admin-logo-box">
				<a class="logo" title="logo">考试管理系统</a>
				<div class="larry-side-menu">
					<i class="fa fa-th-large" aria-hidden="true"></i>
				</div>
			</div>
            <!--<ul class="layui-nav layui-layout-left layui-ygyd-menu" style="position:absolute; left:250px;">
      <li class="layui-nav-item"><a href="">合作机构</a></li>
      <li class="layui-nav-item"><a href="javascript:;">订单管理</a></li>
      <li class="layui-nav-item"><a href="">统计报表</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">系统管理</a>
        <dl class="layui-nav-child">
          <dd><a href="">角色管理</a></dd>
          <dd><a href="">权限设置</a></dd>
          <dd><a href="">日志管理</a></dd>
        </dl>
      </li>
    </ul>-->
    
      <ul class="layui-nav" lay-filter="">
      <!-- <li class="layui-nav-item">
                        <a href="" title="消息">
                            <i class="layui-icon" style="top: 1px;">&#xe63a;</i>
                        </a>
                        </li> -->
        <li class="layui-nav-item"><img src="./images/logo.png" class="layui-circle" style="border: 2px solid #A9B7B7;" width="35px" alt=""></li>
        <li class="layui-nav-item"> <a id="spName" href="javascript:;">
        	
        </a>
          <dl class="layui-nav-child">
            <!-- 二级菜单 -->
            <dd><a href="">个人信息</a></dd>
            <dd><a href="">切换帐号</a></dd>
            <dd><a id="logout">退出</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item x-index"><a href="/">前台首页</a></li>
      </ul>
    </div>
  </div>
  <div class="layui-side layui-bg-black x-side" style="left:-200px;">
    <div class="layui-side-scroll">
      <ul id="nav_ul" class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">
        
        <!-- <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon" style="top: 3px;">&#xe614;</i><cite>系统设置</cite> </a>
          <dl class="layui-nav-child">
            <dd class=""> <a href="javascript:;" _href="./sys-log.html"> <cite>模块管理</cite> </a> </dd>
            <dd class=""> <a href="javascript:;" _href="./sys-link.html"> <cite>角色管理</cite> </a> </dd>
            <dd class=""> <a href="javascript:;" _href="./sys-qq.html"> <cite>用户管理</cite> </a> </dd>
          </dl>
        </li>
        <li class="layui-nav-item" style="height: 30px; text-align: center"> </li> -->
		<!-- <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon" style="top: 3px;">&#xe614;</i><cite>资源室管理</cite> </a>
		  <dl class="layui-nav-child">
		    <dd class=""> <a href="javascript:;" _href="resource_room.html"> <cite>资源室列表</cite> </a> </dd>
		  </dl>
		</li>
		<li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon" style="top: 3px;">&#xe614;</i><cite>资源管理</cite> </a>
		  <dl class="layui-nav-child">
		    <dd class=""> <a href="javascript:;" _href="book.html"> <cite>图书列表</cite> </a> </dd>
		    <dd class=""> <a href="javascript:;" _href="computer.html"> <cite>电脑列表</cite> </a> </dd>
		  </dl>
		</li> -->
      </ul>
    </div>
  </div>
  <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true" style="left: 0px;border-left: solid 2px #2299ee;">
    <ul class="layui-tab-title">
      <li class="layui-this welcome"> 我的桌面 <i class="layui-icon layui-unselect layui-tab-close">?</i> </li>
    </ul>
    <div class="layui-tab-content site-demo site-demo-body">
      <div class="layui-tab-item layui-show">
        <iframe frameborder="0" src="./welcome.html" class="x-iframe"></iframe>
      </div>
    </div>
  </div>
  <div class="site-mobile-shade"> </div>
</div>
<script type="application/javascript">
	layui.use(['layer','element'],function(){
		var layer=layui.layer,
		//element=layui.element,
		$=layui.$;
		//验证token
		// $.ajax({
		// 	type : "get",
		// 	url : globalData.server+"user/tokenCheck",
		// 	data:{},//需要传递到服务端的数据
		// 	dataType:'json',//服务端响应数据类型
		// 	xhrFields: {
		// 		withCredentials: true
		// 	},
		// 	beforeSend: function(request) {
		// 		request.setRequestHeader("token", globalData.getCurToken());
		// 	},
		// 	success : function(res) {
		// 	},
		// 	error:function(res){
		// 		//跳转登录页面
		// 		layer.msg("您还没登录，请先登录!",{icon:2,time:2000},function(){
		// 			top.location.href="login.html";	
		// 		});
		// 	}
		// });
		
		$("#spName").html(globalData.getCurUserName());
		//获取该用户的所有权限
		// $.ajax({
		// 	type : "get",
		// 	url : globalData.server+"user/getPermissionsByUserRoles",
		// 	data:{
		// 		"userId":globalData.getCurUserId()
		// 	},//需要传递到服务端的数据
		// 	dataType:'json',//服务端响应数据类型
		// 	xhrFields: {
		// 		withCredentials: true
		// 	},
		// 	// beforeSend: function(request) {
		// 	// 	request.setRequestHeader("token", globalData.getCurToken());
		// 	// },
		// 	success : function(res) {
		// 		globalData.setCurUserPermissions(JSON.stringify(res));//
		// 		//console.log(globalData.getCurUserPermissions());
		// 	}
		// });
		
		//安全退出
		$("#logout").click(function(){
				layer.confirm('确认退出吗?',{icon:3,title:'退出系统'},function(index){
					layer.close(index);
					
					$.ajax({
					        type : "get",
					        url : globalData.permissionServer+"/logout",
						    data:{},//需要传递到服务端的数据
						    dataType:'json',//服务端响应数据类型
					        xhrFields: {
					            withCredentials: true
					        },
							// beforeSend: function(request) {
							// 	request.setRequestHeader("token", globalData.getCurToken());
							// },
					        complete : function(res) {
					            //清空缓存数据并跳转到登录页面
					            globalData.logout();
					            top.location.href="login.html";
					        }
					    });
				},function(index){
					layer.close(index);
				});
		});
	});
	
				
</script>
</body>
</html>